package com.service;

import com.bean.PersonBean;
import com.dao.impl.UserDao;

public class UserService {
	private UserDao userDao;
	
	public boolean hasMatchUser(String ename, String password){
		int count = userDao.queryLogin(ename, password);
		return count>0;
	}
	
	public PersonBean findUserByEname(String ename){
		return userDao.getUserInfo(ename);
	}
	
	public int loginSuccess(String ename){
		return userDao.updateLogin(ename);
	}
	
	public String queryPassword(String ename){
		return userDao.queryPassword(ename);
	}
	
	public int updatePassword(String ename, String newPassword){
		return userDao.updatePassword(ename, newPassword);
	}
	
	
	public UserDao getUserDao() {
		return userDao;
	}

	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}
}
